Converts a POCO EntityCollection<(Of <(<'TEntity>)>)> to an editable live view.
Namespace:
C1.Data.EntitiesAssembly: C1.Data.Entity (in C1.Data.Entity.dll)
Syntax
C# |
---|
public static View<T> AsLive<T>( this ICollection<T> pocoCollection, EntityClientScope scope ) where T : class |
Visual Basic |
---|
<ExtensionAttribute> _ Public Shared Function AsLive(Of T As Class) ( _ pocoCollection As ICollection(Of T), _ scope As EntityClientScope _ ) As View(Of T) |
Parameters
- pocoCollection
- Type: System.Collections.Generic..::..ICollection<(Of <(<'T>)>)>
The entity collection to convert. It must be of type EntityCollection<(Of <(<'TEntity>)>)>.
- scope
- Type: C1.Data.Entities..::..EntityClientScope
The EntityClientScope to which the entity owning this collection belongs (in which it was fetched by a query or created).
Type Parameters
- T
- The type of the entities in the pocoCollection.
Return Value
The resulting live view.Remarks
When POCO objects are used (with proxies), navigation collection properties are typed
as ICollection<(Of <(<'T>)>)>, not EntityCollection<(Of <(<'TEntity>)>)> (although they are EntityCollection<(Of <(<'TEntity>)>)> at run time).
That is why a special AsLive extension method must be used.
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentException | The pocoCollection is not of type EntityCollection<(Of <(<'TEntity>)>)>. |